package cn.qicaiwang.open.app.controller;

import cn.qicaiwang.open.app.entity.Enterprise;
import cn.qicaiwang.open.app.server.EnterpriseService;
import cn.qicaiwang.open.common.response.ResponseResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/qcwapp/enterprise")
public class AppEnterpriseController {
    @Resource
    private EnterpriseService enterpriseService;

    /**
     * 根据企业名称和省份名称查询公司基本信息
     * @return 查询结果
     */
    @PostMapping("/fuzzySearch")
    public ResponseResult fuzzySearch(@RequestBody Enterprise enterprise) {
        String name=enterprise.getEnterpriseName();
        String province=enterprise.getProvince();
        List<Map<String, Object>> result = enterpriseService.fuzzySearchByName(name, province);
        return ResponseResult.ok(result);
    }


}
